﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;

namespace CineProwl.Domain
{
    public class BaseEntity
    {
        public void Join<T>(T secondary)
        {
            PropertyInfo[] properties = this.GetType().GetProperties();
            foreach (PropertyInfo prop in properties)
            {
                if (prop.GetValue(this, null) == null && prop.GetValue(secondary, null) != null)
                {
                    prop.SetValue(this, prop.GetValue(secondary, null), null);
                }
            }
        }
    }
}
